<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="PopUpMenuButtonBase,flexlib.baseClasses.PopUpMenuButtonBase,popUp,dataDescriptor,dataProvider,labelField,labelFunction,showRoot" name="keywords">
<title>flexlib.baseClasses.PopUpMenuButtonBase</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'PopUpMenuButtonBase - flexlib';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?flexlib/baseClasses/PopUpMenuButtonBase.html&amp;flexlib/baseClasses/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;PopUpMenuButtonBase</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class PopUpMenuButtonBase"); titleBar_setSubNav(false,true,false,false,true,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">flexlib.baseClasses</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class PopUpMenuButtonBase</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">PopUpMenuButtonBase <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> mx.controls.PopUpButton</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Subclasses</td><td><a href="../controls/ScrollablePopUpMenuButton.html">ScrollablePopUpMenuButton</a></td>
</tr>
</table>
<p></p>
  PopUpMenuButtonBase is a copy/paste version of the original PopUpMenuButton class in the Flex framework.
 
  <p>The only modifications made to this class were to change some properties and
 methods from private to protected so we can override them in a subclass.</p>
 
  <p>The PopUpMenuButton control creates a PopUpButton control with a main
  sub-button and a secondary sub-button.
  Clicking on the secondary (right) sub-button drops down a menu that
  can be popluated through a <code>dataProvider</code> property. 
  Unlike the Menu and MenuBar controls, the PopUpMenuButton control 
  supports only a single-level menu. This means that the menu cannot contain
  cascading submenus.</p>
 
  <p>The main sub-button of the PopUpMenuButton control can have a text
  label, an icon, or both on its face.
  When a user selects an item from the drop-down menu or clicks the main 
  button of the PopUpMenuButton control, the control dispatches an 
  <code>itemClick</code> event.
  When a user clicks the main button of the 
  control, the control also dispatches a <code>click</code> event. 
  You can customize the look of a PopUpMenuButton control.</p>
   <p></p>
<a name="mxmlSyntaxSummary"></a><span class="classHeaderTableLabel">MXML Syntax</span><span style="display:none" id="showMxmlLink"><a onclick="toggleMXMLOnly();" href="#mxmlSyntaxSummary"><img class="collapsedImage" alt="collapsed" title="collapsed" src="../../images/collapsed.gif"> Show MXML Syntax</a>
<br>
</span><span id="hideMxmlLink"><a onclick="toggleMXMLOnly();" href="#mxmlSyntaxSummary"><img class="expandedImage" alt="expanded" title="expanded" src="../../images/expanded.gif"> Hide MXML Syntax</a></span>
<div class="mxmlSyntax" id="mxmlSyntax">  
  <p>The <code>&lt;mx:PopUpMenuButton&gt;</code> tag inherits all of the tag
  attributes of its superclass, and adds the following tag attributes:</p>
  
  <pre>
  &lt;mx:PopUpMenuButton
    <strong>Properties</strong>
    dataDescriptor="<i>instance of DefaultDataDescriptor</i>"
    dataProvider="undefined"
    labelField="null"
    labelFunction="undefined"
    showRoot="false|true"
    &nbsp;
    <strong>Event</strong>
    change=<i>No default</i>
  /&gt;
  </pre>
  
   </div>
<script type="text/javascript" language="javascript">
<!--
setMXMLOnly();
--></script>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">mx.controls.Menu<br>mx.controls.MenuBar</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#dataDescriptor">dataDescriptor</a> : IMenuDataDescriptor<div class="summaryTableDescription">
      The data descriptor accesses and manipulates data in the data provider.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#dataProvider">dataProvider</a> : Object<div class="summaryTableDescription">
      DataProvider for popUpMenu.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#labelField">labelField</a> : String<div class="summaryTableDescription">
      Name of the field in the <code>dataProvider</code> Array that contains the text to
      show for each menu item.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#labelFunction">labelFunction</a> : Function<div class="summaryTableDescription">
      A function that determines the text to display for each menu item.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#popUp">popUp</a> : IUIComponent<div class="summaryTableDescription">[write-only]
      A reference to the pop-up Menu object.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#showRoot">showRoot</a> : Boolean<div class="summaryTableDescription">
      Specifies whether to display the top-level node or nodes of the data provider.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#PopUpMenuButtonBase()">PopUpMenuButtonBase</a>()</div>
<div class="summaryTableDescription">
      Constructor.</div>
</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
</table>
</div>
<a name="eventSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Events</div>
<table id="summaryTableEvent" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Event</th><th>Summary</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#event:itemClick">itemClick</a>
</div>
</td><td class="summaryTableDescription summaryTableCol">
  Dispatched when a user selects an item from the pop-up menu.</td><td class="summaryTableOwnerCol">PopUpMenuButtonBase</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="dataDescriptor"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">dataDescriptor</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>dataDescriptor:IMenuDataDescriptor</code>&nbsp;&nbsp;[read-write]<p>
      The data descriptor accesses and manipulates data in the data provider.
      </p><p>When you specify this property as an attribute in MXML, you must
      use a reference to the data descriptor, not the string name of the
      descriptor. Use the following format for the property:</p>
           <pre>&lt;mx:PopUpMenuButton id="menubar" dataDescriptor="{new MyCustomDataDescriptor()}"/&gt;</pre>
           <p>Alternatively, you can specify the property in MXML as a nested
      subtag, as the following example shows:</p>
           <pre>&lt;mx:PopUpMenuButton&gt;
      &lt;mx:dataDescriptor&gt;
         &lt;myCustomDataDescriptor&gt;
      &lt;/mx:dataDescriptor&gt;
      ...</pre>
           <p>The default value is an internal instance of the
      DefaultDataDescriptor class.</p>
     <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get dataDescriptor():IMenuDataDescriptor</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set dataDescriptor(value:IMenuDataDescriptor):void</code>
<br>
</div>
<a name="dataProvider"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">dataProvider</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>dataProvider:Object</code>&nbsp;&nbsp;[read-write]<p>
      DataProvider for popUpMenu.
           </p><p>The default value is <code>null</code>.</p>
<p>This property can be used as the source for data binding.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get dataProvider():Object</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set dataProvider(value:Object):void</code>
<br>
</div>
<a name="labelField"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">labelField</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>labelField:String</code>&nbsp;&nbsp;[read-write]<p>
      Name of the field in the <code>dataProvider</code> Array that contains the text to
      show for each menu item.
      The <code>labelFunction</code> property, if set, overrides this property.
      If the data provider is an Array of Strings, Flex uses each String
      value as the label.
      If the data provider is an E4X XML object, you must set this property
      explicitly; for example, use &#064;label to specify the <code>label</code> attribute.
           </p><p>The default value is <code>"label"</code>.</p>
<p>This property can be used as the source for data binding.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get labelField():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set labelField(value:String):void</code>
<br>
</div>
<a name="labelFunction"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">labelFunction</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>labelFunction:Function</code>&nbsp;&nbsp;[read-write]<p>
      A function that determines the text to display for each menu item.
      If you omit this property, Flex uses the contents of the field or attribute
      determined by the <code>labelField</code> property.
      If you specify this property, Flex ignores any <code>labelField</code>
      property value.
           </p><p>If you specify this property, the label function must find the
      appropriate field or fields and return a displayable string.
      The <code>labelFunction</code> property is good for handling formatting
      and localization.</p>
           <p>The label function must take a single argument which is the item
      in the dataProvider and return a String.</p>
     
      <blockquote>
      <code>labelFunction(item:Object):String</code>
      </blockquote>
           <p>The default value is <code>null</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get labelFunction():Function</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set labelFunction(value:Function):void</code>
<br>
</div>
<a name="popUp"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">popUp</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>popUp:IUIComponent</code>&nbsp;&nbsp;[write-only]<p>
      A reference to the pop-up Menu object.
           </p><p>This property is read-only, and setting it has no effect.
      Set the <code>dataProvider</code> property, instead.
      (The write-only indicator appears in the syntax summary because the
      property in the superclass is read-write and this class overrides
      the setter with an empty implementation.)</p>
     <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set popUp(value:IUIComponent):void</code>
<br>
</div>
<a name="showRoot"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">showRoot</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>showRoot:Boolean</code>&nbsp;&nbsp;[read-write]<p>
      Specifies whether to display the top-level node or nodes of the data provider.
           If this is set to <code>false</code>, the control displays
      only descendants of the first top-level node.
      Any other top-level nodes are ignored.
      You normally set this property to <code>false</code> for
      E4X format XML data providers, where the top-level node is the document
      object.
           </p><p>The default value is <code>true</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get showRoot():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set showRoot(value:Boolean):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="PopUpMenuButtonBase()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">PopUpMenuButtonBase</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function PopUpMenuButtonBase()</code><p>
      Constructor.
     </p></div>
<div class="detailSectionHeader">Event detail</div>
<a name="event:itemClick"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">itemClick</td><td class="detailHeaderType">event&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<span class="label">Event object type: </span><a href=""><code>mx.events.MenuEvent</code></a>
<br>
<p></p><p>
  Dispatched when a user selects an item from the pop-up menu.
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
